<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <!-- 引入Vue -->
    <script src="/dist/vue.min.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="/dist/styles/iview.css">
    <!-- 引入组件库 -->
    <script src="/dist/iview.min.js"></script>
</head>

<style>
    .layout {
        border: 1px solid #d7dde4;
        background: #f5f7f9;
    }

    .layout-logo {
        width: 100px;
        height: 30px;
        background: #5b6270;
        border-radius: 3px;
        float: left;
        position: relative;
        top: 15px;
        left: 20px;
    }

    .layout-nav {
        width: 420px;
        margin: 0 auto;
    }

    .layout-assistant {
        width: 300px;
        margin: 0 auto;
        height: inherit;
    }

    .layout-breadcrumb {
        padding: 10px 15px 0;
    }

    .layout-content {
        min-height: 200px;
        margin: 15px;
        overflow: hidden;
        background: #fff;
        border-radius: 4px;
    }

    .layout-content-main {
        padding: 10px;
    }

    .layout-copy {
        text-align: center;
        padding: 10px 0 20px;
        color: #9ea7b4;
    }
</style>



<body>
    <div id="app">
        <Main></Main>
    </div>
</body>

<template id="layout1">
        <div class="layout">
                <Row type="flex">
                        <i-col span="4" class="layout-menu-left">
                            <Menu active-key="1-2" theme="dark" width="auto" :open-keys="['1']">
                                <div class="layout-logo-left"></div>
                                <Submenu key="1">
                                    <template slot="title">
                                        <Icon type="ios-navigate"></Icon>
                                        导航一
                                    </template>
                                    <Menu-item key="1-1">选项 1</Menu-item>
                                    <Menu-item key="1-2">选项 2</Menu-item>
                                    <Menu-item key="1-3">选项 3</Menu-item>
                                </Submenu>
                                <Submenu key="2">
                                    <template slot="title">
                                        <Icon type="ios-keypad"></Icon>
                                        导航二
                                    </template>
                                    <Menu-item key="2-1">选项 1</Menu-item>
                                    <Menu-item key="2-2">选项 2</Menu-item>
                                </Submenu>
                                <Submenu key="3">
                                    <template slot="title">
                                        <Icon type="ios-analytics"></Icon>
                                        导航三
                                    </template>
                                    <Menu-item key="3-1">选项 1</Menu-item>
                                    <Menu-item key="3-2">选项 2</Menu-item>
                                </Submenu>
                            </Menu>
                        </i-col>
                        <i-col span="19">
                            <div class="layout-header"></div>
                            <div class="layout-breadcrumb">
                                <Breadcrumb>
                                    <Breadcrumb-item href="#">首页</Breadcrumb-item>
                                    <Breadcrumb-item href="#">应用中心</Breadcrumb-item>
                                    <Breadcrumb-item>某应用</Breadcrumb-item>
                                </Breadcrumb>
                            </div>
                            <div class="layout-content">
                                <div class="layout-content-main">
                                    <S1></S1>
                                </div>
                            </div>
                            <div class="layout-copy">
                                2011-2016 &copy; TalkingData
                            </div>
                        </i-col>
                    </Row>
        </div>
    </template>

    <template id="s1">
        <Switch v-model="switch1" @on-change="change" />
    </template>
<script>
    Vue.component('Main', {
        template: "#layout1"
    })
    Vue.component("S1",{
        template:"#s1",
        data(){
            return {
                switch1: false
            } 
        },
        methods: {
            change (status) {
                this.$Message.info('开关状态：' + status);
            }
        }
    });
    new Vue({
        el: '#app',
        data: {
            visible: false
        },
        methods: {
            show: function () {
                this.visible = true;
            }
        }
    })
</script>

</html>